let  parse = require('@babel/parser').parse 

let ast = parse("function hi(){console['\x6c\x6f\x67']('\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21');}hi();")
traverse = require("@babel/traverse").default
// function get(dic){
//     if ('type' in dic && dic['type'] == "StringLiteral"){
//         console.log(dic['extra'])
//         dic['extra']['raw'] = '"' + dic.value + '"'
//     }
//     else { 
//         for (a in dic){
//             if (dic[a] && typeof dic[a] =='object'){
//                 get(dic[a])
//             }
//         }
//     }
// }

// get(ast)

traverse(ast,{
    StringLiteral:function(path){
        console.log(path.node)
        path.node.value = path.node.extra.rawValue
    },

})

let generate = require('@babel/generator').default

let out_code = generate(ast).code
console.log(out_code)






